<script setup>
import { useLanguageStore } from '@/stores/language'
const store = useLanguageStore()
const toggleLanguage = () => {
  const newLang = store.currentLang === 'zh' ? 'en' : 'zh'
  store.switchLanguage(newLang)
}
</script>

<template>
  <div class="current-language" @click="toggleLanguage">
    <div v-show="store.currentLang === 'zh'">
      <img src="@/assets/icons/zh-cn.svg">
    </div>
    <div v-show="store.currentLang === 'en'">
      <img src="@/assets/icons/en-us.svg">
    </div>
  </div>
</template>

<style scoped>
.current-language{
  width: auto;
  height: 10vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
img{
  margin-top: 7px;
}
</style>